package device;

public class Host {
	public Host() {
		hostID = ++hostNum;
	}

	public Host(String dottedNetAddress, String physAddress) {
		hostID = ++hostNum;
		this.dottedNetAddress = dottedNetAddress;
		this.physAddress = physAddress;
	}

	public void setName(String name) {
		hostName = name;
	}

	public void setVisited(boolean v) {
		visited = v;
	}

	public boolean isVisited() {
		return visited;
	}
	
	private int getHostID() {
		return hostID;
	}
	
	@Override
	public boolean equals(Object o) {
		if (o instanceof Host) {
			Host h = (Host) o;
			if (h.getHostID() == hostID
					|| (h.dottedNetAddress == dottedNetAddress && h.physAddress == physAddress))
				return true;
		}
		return false;
	}
	
	public int type; // terminal or switch
	public String hostName;
	public int hostID;
	public String dottedNetAddress; // Network address in dotted notation
	public String physAddress; // MAC address
	private boolean visited = false;
	private static int hostNum = 0;
}